"""Build security test"""
import daos_build

def scons():
    """Execute build"""
    Import('env', 'prereqs', 'dc_sectest_tgts')

    libs = ['$LIBS', 'daos', 'daos_common', 'gurt']
    sec_sources = ['security_test.c', dc_sectest_tgts]
    acl_sources = ['acl_dump_test.c']

    denv = env.Clone()
    denv.AppendUnique(CFLAGS=['-std=gnu99'])
    denv.AppendUnique(CPPDEFINES=['TEST'])

    prereqs.require(denv, 'argobots', 'protobufc', 'hwloc')

    security_test = daos_build.program(denv, 'security_test', sec_sources,
                                       LIBS=libs)
    env.Install('$PREFIX/bin/', security_test)

    acl_dump_test = daos_build.program(denv, 'acl_dump_test', acl_sources,
                                       LIBS=libs)
    env.Install('$PREFIX/bin/', acl_dump_test)

if __name__ == "SCons.Script":
    scons()
